
set AIHOME $env(AIOSS_HOME)
set SERVICE_NAME UNIF

global g_channel
global g_county_id
global g_office_id
global g_operator_id

set g_channel "EC"
set g_county_id "Z00"
set g_office_id "Z00000"
set g_operator_id "INTUIF"


source $AIHOME/etc/db.tcl
source $AIHOME/etc/ui_txt_interp.tcl
source $AIHOME/etc/proc.tcl
source $AIHOME/etc/comm.tcl

encoding system identity

proc checkin {a b c d} {
	
}

proc backup {p1 p2 p3} {
        set context [lindex [lindex $p3 0] 0]
        return "{{00000} {$context}}"
}

proc sleep {p1 p2 p3} {
	exec sleep [lindex [lindex $p3 0] 0]
	return "{{00000}}"
}

proc list_to_array { user result } {
	upvar $result ret
		set discrete ""
		foreach item $user {
#set single [split $item]
			foreach ele $item {
				lappend discrete $ele
			}
		}
	array set ret $discrete
}

set a 1

proc 103011901001 { req } {
	list_to_array  $req info
	return $req
}

proc 102011202000 { req } {
	list_to_array  $req info
	set a1 $info(A1)
	set a2 $info(A2)
	set content $info(CONTENT)

#	exec sleep 1
	incr ::a
	return $::a
#	return ""
}

proc 102011207000 { req } {
	if {[clock format [clock seconds] -format %e] <= 30} {
		return -code error "Unsupported from 1st to 3rd day of a month"
	}

	return "{TP A} {BOUNTY BBBBBBBBB} {TOTFEE CCCCCCCCC} {ARRFEE DDDDDDDDD} \
		{BILLFEE EEEEEEEEE} {FAVOR FFFFFFFF} {BASEFEE GGGGGGGGG} \
		{REMAIN HHHHHHHHH} {HFYE IIIIIIIII}"
}

proc Bind { req } {
	return "{Result 0} {Reserve xxxxxxxx}"
}

